<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>flex 方案</title>
  <style>
    /* 注意这里，一定要设置！！！ */
    html, body, .container {
      height: 100%;
    }
    .container {
      display: flex;
      flex-direction: column;
    }
    .header {
      height: 200px;
      background: #d7f;
    }
    .middle {
      flex: 1;
      background: #cae2f9;
    }
    .footer {
      height: 200px;
      background: #4086a9;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="header"></div>
    <div class="middle"></div>
    <div class="footer"></div>
  </div>
</body>
</html>
